package com.ruoyi.project.beautyflower.repaymentPlan.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.project.beautyflower.repaymentPlan.mapper.RepaymentPlanMapper;
import com.ruoyi.project.beautyflower.repaymentPlan.domain.RepaymentPlan;
import com.ruoyi.project.beautyflower.repaymentPlan.service.IRepaymentPlanService;
import com.ruoyi.common.support.Convert;

/**
 * 还款计划 服务层实现
 *
 * @author lxs
 * @date 2018-10-16
 */
@Service
public class RepaymentPlanServiceImpl implements IRepaymentPlanService {
    @Autowired
    private RepaymentPlanMapper repaymentPlanMapper;

    /**
     * 查询还款计划信息
     *
     * @param id 还款计划ID
     * @return 还款计划信息
     */
    @Override
    public RepaymentPlan selectRepaymentPlanById(Integer id) {
        return repaymentPlanMapper.selectRepaymentPlanById(id);
    }

    /**
     * 查询还款计划列表
     *
     * @param repaymentPlan 还款计划信息
     * @return 还款计划集合
     */
    @Override
    public List<RepaymentPlan> selectRepaymentPlanList(RepaymentPlan repaymentPlan) {
        return repaymentPlanMapper.selectRepaymentPlanList(repaymentPlan);
    }

    /**
     * 新增还款计划
     *
     * @param repaymentPlan 还款计划信息
     * @return 结果
     */
    @Override
    public int insertRepaymentPlan(RepaymentPlan repaymentPlan) {
        return repaymentPlanMapper.insertRepaymentPlan(repaymentPlan);
    }

    /**
     * 修改还款计划
     *
     * @param repaymentPlan 还款计划信息
     * @return 结果
     */
    @Override
    public int updateRepaymentPlan(RepaymentPlan repaymentPlan) {
        return repaymentPlanMapper.updateRepaymentPlan(repaymentPlan);
    }

    /**
     * 删除还款计划对象
     *
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteRepaymentPlanByIds(String ids) {
        return repaymentPlanMapper.deleteRepaymentPlanByIds(Convert.toStrArray(ids));
    }

    /**
     * 查询还款计划列表
     *
     * @param repaymentPlan 还款计划信息
     * @return 还款计划集合
     */
    @Override
    public List<RepaymentPlan> selectList(RepaymentPlan repaymentPlan) {
        return repaymentPlanMapper.selectList(repaymentPlan);
    }

    @Override
    public RepaymentPlan selectOrderByListByOrderNumberAndinstallmentNo(String orderNumber, String installmentNo) {
        return repaymentPlanMapper.selectOrderByListByOrderNumberAndinstallmentNo(orderNumber,installmentNo);
    }

    @Override
    public List<RepaymentPlan> selectOrderByListByOrderNumber(String orderNumber) {
        return repaymentPlanMapper.selectOrderByListByOrderNumber(orderNumber);
    }
}
